home *** CD-ROM | disk | FTP | other *** search
/ MIDICraft's MIDINET CD-ROM / MIDICraft's MIDINET CD-ROM.iso / DOSUTILS / MIDIFADE.DOC < prev    next >
Text File  |  1996-10-05  |  8KB  |  210 lines

  1.         ******************************
  2.             MIDIFADE v1.2
  3.     
  4.         fade in/out of midi binaries 
  5.               by Guenter Nagler 
  6.                 1996 
  7.           (gnagler@ihm.tu-graz.ac.at)
  8.         ******************************
  9.  
  10. [0] FEATURES
  11.     + reads a binary midi file (version 0, 1)
  12.     + writes a binary midi file
  13.     + fadein:  increases volume in given time to a given level
  14.     + fadeout: decreases volume in given time to a given level
  15.     + velocity changes by percent of original velocity
  16.     + shows length of song (time and midi units)
  17.     + shows length of tracks (seperated parts where notes are playing)
  18.  
  19. [1] BACKGROUND
  20. All good midi files should have a fantastic intro and a good 
  21. ending. One effect that is often used by musicians is fading.
  22. It produces a soft start and end of a song.
  23. Only few sequencers support fade in/out of songs. 
  24. My keyboard sequencer has ability to manually play more louder
  25. but automatic fading is not available.
  26. This encouraged me to write a utility that fades a midisong
  27. at given time and velocity parameters.
  28. It is a new challenge for me to handle midi tempo commands
  29. even when it changes anytime in any track.
  30.  
  31. [2] FILES DESCRIPTION
  32.  
  33. MIDIFADE.EXE.........converter program
  34. MIDIFADE.DOC.........this file, showing usage of MIDIFADE.EXE
  35. MIDIIO.HPP...........header file for a c++ midi parser
  36. MIDIIO.CPP...........source code for a c++ midi parser
  37. MIDIFADE.CPP.........c++ source code for midi to text
  38. MIDIFADE.MAK.........make file for project 
  39. MIDIFADE.CFG.........compiler options for make
  40. MIDIFADE.PRJ.........compiler project for borland c++ compilers
  41. only MIDIFADE.EXE is required to run program
  42.  
  43. [3] COPYRIGHT
  44.  
  45. MIDIFADE (c) 1996 was created by Guenter Nagler.
  46.  
  47. MIDIFADE is free and may be used as you wish with this one exception:
  48.  
  49.     You may NOT charge any fee or derive any profit for distribution
  50.     of MIDIFADE.  Thus, you may NOT sell or bundle MIDIFADE with any 
  51.     product in a retail environment (shareware disk distribution, CD-ROM,
  52.     etc.) without permission of the author.
  53.  
  54. You may give MIDIFADE to your friends, upload it to a BBS, or ftp it to
  55. another internet site, as long as you don't charge anything for it.
  56.  
  57. [4] DISCLAIMER
  58.  
  59. MIDIFADE handles 100% compatible midi files of formats 0 (one multichannel 
  60. track) or format 1 (several single channel track with leading nonchannel 
  61. track).    The program will produce a binary midi of same format including
  62. additional volume commands to fade parts of the midi file linear.
  63. I give no guarantees of the results, especially with non 100%
  64. compatible midi files.
  65. If you find a midi file that you think to be 100% compatible midi
  66. that is not correctly converted, please send a sample file to
  67. gnagler@ihm.tu-graz.ac.at .
  68.  
  69. Use MIDIFADE at your own risk.  Anything you do with MIDIFADE is your
  70. responsibility, and not the author's.  Any damage caused to any person,
  71. computer, software, hardware, company, or business by running MIDIFADE 
  72. is your responsibility, and the author will not be liable.
  73.  
  74. If you don't understand these terms, or are not sure of something, or
  75. are afraid something bad might come of using MIDIFADE, don't  use  it!
  76. You are here forewarned.
  77.  
  78. Warning: 
  79.   Always keep the original midi file until you are sure that 
  80.   the resulting midi file is what you expected. The fade operation 
  81.   cannot be undone!
  82.  
  83. [5] INSTALLATION
  84.  
  85. [MSDOS]
  86. Simply copy MIDIFADE.EXE in a directory that is in your path.
  87. When you start the program without arguments
  88.  
  89. C:\> MIDIFADE
  90.  
  91. [UNIX]
  92. compile sources with your C++ compiler (e.g. GNU Compiler g++):
  93.  
  94. g++ -o midifade midifade.cpp midiio.cpp
  95.  
  96. and run program
  97.  
  98. $ midifade
  99.  
  100.  
  101. you should get the usage text (see next section)
  102.  
  103. [6] USAGE
  104.  
  105. usage: MIDIFADE [options] midifile.mid midifade.mid
  106.  
  107. The parts in brackets [...] are optional.
  108. options:
  109.   -time        show time table where notes are played
  110.   -songtime    show time of whole song only
  111.   -channel # #    fade only these channels # # (1-16)    
  112.   -sv #        start velocity percentage (0-100)
  113.   -ev #        end velocity percentage (0-100)
  114.   -st #        start time
  115.   -et #        end time
  116.   -fadein    same as -sv 0 -ev 100 -st 0:0
  117.   -fadeout    same as -sv 100 -ev 0 no -et (end of song)
  118.   accepted time formats are:
  119.     mm:ss[.microseconds] or #u in midi units or #b in beats
  120.  
  121. If option -time is specified the program does not produce an output 
  122. file (need not specify output filename). 
  123. In this case valuable information is printed that helps
  124. finding unit and time positions of note playing sections.
  125. It shows start and end time of song.
  126.  
  127. Alternate time formats can be used to enter start and end of fade time:
  128. a)  mm:ss[.microseconds] as e.g. 1:30  or 2:59.500000
  129.     where mm is minute value (0-70)
  130.           ss is second value (0-59)
  131.           microseconds value (0-999999, default is 0)
  132. b)  #b  number of beats (same as quarternotes) from beginning of song
  133.     e.g.  123b   0b   93B
  134.  
  135. c)  #u  number of midi time units from the beginning of song
  136.     e.g. 24960u 0u  34115U
  137.  
  138.     The number of units per beat can be found in midi file header 
  139.      (mostly 96 or 192) using MIDI2TXT.
  140.  
  141. By default all channels that contain note commands are effected
  142. by fading (only in given range start time - end time). 
  143. With option -channel one or more channels (between 1 and 16) can 
  144. be chosen that should be faded.
  145. E.g. -channel 1 5 10   will fade only notes played on this channels
  146.  
  147. Options -sv and -ev start percentage and end percentage of note velocities. 
  148. If the value of -sv option is smaller than value of -ev we speak of "fade in" 
  149. otherwise it is called "fade out".
  150.  
  151. Options -st and -et set range of affected notes. Two time values 
  152. are given where time value of -et must be greater than -st that any
  153. fade can be applied to notes.
  154.  
  155. Have a look at examples in [9].
  156.  
  157. [8] SUGGESTIONS / COMMENTS / BUG REPORTS / QUESTIONS
  158.  
  159.          WWW:    http://hgiicm.tu-graz.ac.at/Cpub
  160.           contains all my dos/unix midi programs
  161.          EMAIL:  gnagler@ihm.tu-graz.ac.at
  162.  
  163. [9] USE
  164.  
  165. e.g.  fade-in from start 10 seconds long:
  166.  
  167. midifade -fadein -et 0:10 original.mid fadein.mid
  168.  
  169. e.g.  fade-out 10 seconds before end of midi file
  170. hint: first show song time to be able to specify
  171. a good -st value
  172.  
  173. midifade -time original.mid
  174. song:                 units   384 - 54144   time 0:02.448768 - 5:45.276288
  175.  
  176. midifade -fadeout -st 5:35.276288 original.mid fadeout.mid
  177.  
  178. Hint: you can write -st 5:35 if the time need not be exact to 
  179. microseconds steps.
  180.  
  181. e.g. fade-in drums between certain time 
  182.  
  183. midifade -channel 10 -st 0:35 -et 0.53 -sv 10 -ev 120 original.mid fadein.mid
  184.  
  185. It is allowed to use percentage values for -sv and -ev option that are
  186. greater than 100. The original velocity will increase in this range, but
  187. never will exceed the range 0-127.
  188.  
  189. [10] CHANGES
  190. v1.0 to v1.1:
  191.   * multiplication overflow bug fixed
  192.   * velocity changes relative to original velocity to keep the mix
  193.     of track volumes (instead of replacing velocity values).
  194.  
  195. v1.1 to v1.2:
  196.   * used updated midiio
  197.   * added error messages for different types of errors (file not found, 
  198.     invalid time range, ...)
  199.   * default -st set to start of song
  200.   * default -et set to end of song
  201.   * new option -songtime for getting time of whole song only
  202.   * new option -fadein as shortcut for fadein from start of song
  203.      is same as using options -sv 0 -ev 100 -st 0:0
  204.      (only need to use -et to set end time  e.g. -et 0:10 for
  205.       10 seconds fadein)
  206.   * new option -fadeout as shortcut for fadeout till end of song
  207.       is same as using options -sv 100 -ev 0 and default value for
  208.       -et option (that is end of song)
  209.       (only need to use -st to set start time of fade out)
  210.